Registers a Windows API function and the arguments that function takes. RegFn32( ) always calls 32-bit DLLs.
Syntax
RegFn(cFunctionName, cArgTypes, cReturnType, cDLLName)
cFunctionName
Specifies the name or the ordinal value of the function to be registered.
cArgTypes
Specifies a string of characters which describe what arguments the function will accept. The following values are allowed:
Value | Description |
I | Integer (32-bit) |
L | Long |
C | String of characters |
F | Floating point number |
D | Double precision floating point number |
S | Short (16-bit) integer |
Each argument type may be preceded by @ to indicate that the argument is passed by reference. The default is to pass arguments by value.
CReturnType
The return type of the function. The values allowed are the same as given above for the argument except that return by reference isn't allowed.
CDLLName
Specifies the name of the 32-bit DLL library that contains the function. This is optional if the function is in one of the libraries on Win16 (User.exe, Krnl386.exe, and Gdi.exe) or Win32 (Kernel32.dll, Gdi32.dll, User32.dll, Advapi32.dll, and Mpr.dll) platforms.
See the Windows SDK function LoadLibrary for details on how the DLL name is searched.
Return Type
Numeric
Remarks
If successful, RegFn32( ) returns a number which can be used to reference the function in future calls to CallFn( ).
Returns –1 if the library couldn't be opened, and will additionally display a message box.
The same function can be registered more than once. This allows functions that take different arguments to be used by declaring them again with different argument types.